class Feed::EnterItemCreated < Feed
  
  validates :enter_item_id,
    :presence => true
  
  before_create do |feed|    
    self.order_id = enter_item.order_id
    self.order_item_id = enter_item.order_item_id
    self.installation_id = enter_item.installation_id
    self.install_item_id = enter_item.install_item_id
    self.order_made_id = enter_item.order_made_id
    self.order_made_item_id = enter_item.order_made_item_id
    self.furniture_logistic_stat_id = enter_item.furniture_logistic_stat_id
    self.furniture_id = enter_item.furniture_id
  end
    
  def code
    ActiveSupport::StringInquirer.new('has_been_entered')
  end
  
  def short_desc
    "于#{enter_item.entered_on}到货，并<b>存放</b>在【#{furniture_logistic_stat.dept.name}】,共计【#{enter_item.entered_count}件】"
  end
  
  def remark
    enter_item.remark
  end
end